<template>
<div>
  <h1>展示所有老师的信息</h1>
  <table>
    <tr>
      <td>id</td>
      <td>姓名</td>
      <td>密码</td>
      <td>操作</td>
    </tr>
    <tr v-for="i in form">
      <td>{{i.id}}</td>
      <td>{{i.username}}</td>
      <td>{{i.password}}</td>
      <td>
        <button>删除</button>
      </td>
    </tr>
  </table>
</div>
</template>

<script>
export default {
  name: "teacher_show",
  data(){
    return{
      form:{}
    }
  },
  methods:{
    teacher_show(){
      this.$axios.get('teachershow/')
      .then(res=>{
        if (res.data.code==200){
          this.form = res.data.list
        }
      })
    }
  },
  mounted() {
    this.teacher_show()
  }

}
</script>

<style scoped>

</style>
